#include<bits/stdc++.h>
using namespace std;
int a[100001];
int main(){
    freopen("duel.in","r",stdin);freopen("duel.out","w",stdout);
    int n;cin >> n;
    for(int i = 1;i <= n;i++) scanf("%d",&a[i]);
    sort(a + 1,a + n + 1);
    int ready_to_die = 0,dead = 0;
    for(int i = 1;i <= n;i++){
        if(a[i] != a[i-1]) ready_to_die = i - 1 - dead;
        if(ready_to_die > 0) dead++,ready_to_die--;
    }
    cout << n - dead;
    return 0;
}
